public class Foo { private int boo; public void anyMethodOrConstructor() { int boo = 99; boo = 101; } }
public class Foo { private int boo; public void anyMethodOrConstructor() { int boo = 99; this.boo = 101; } }
public class Foo { private int boo; public void anyMethodOrConstructor(int boo) { this.boo = boo; } }
public class Foo { private int boo; public void anyMethodOrConstructor(int aBoo) { this.boo = aBoo; } }
//example #1 //Note assume that method canPrint returns a boolean data type myBooleanVariable = someObject.canPrint(); return myBooleanVariable; //example #2/ //Note assume that method canPrint returns a boolean data type return someObject.canPrint(); //example #3 //Note assume that method canRun returns a boolean data type if (this.canRun()) return true return false; //example #4 //Note assume that method canRun returns a boolean data type return this.canRun()